package extends_.exer1;

/**
 * Created with IntelliJ IDEA.
 * ClassName: Kids
 * Package: extends_.exer1
 * Description:
 * User: fzykd
 *
 * @Author: LQH
 * Date: 2023-11-21
 * Time: 22:44
 */

public class Kids extends Mankind{

    private int yearsOld;

    public Kids(){}

    public Kids(int sex,int salary,int yearsOld){
        this.yearsOld = yearsOld;
        //在没讲supper之前
        setSex(sex);
        setSalary(salary);
    }

    public void printAge(){
        System.out.println("I am " + yearsOld + "years old");
    }

    public Kids(int yearsOld){
        this.yearsOld = yearsOld;
    }

    public int getYearsOld(){
        return yearsOld;
    }

    public void setYearsOld(int yearsOld){
        this.yearsOld = yearsOld;
    }

}
